package com.oo.polymorphic_4.computer;

import java.util.Scanner;

/**
 * ComputerTest--${description}
 *
 * @author: Jovi
 * @createTime: 2017-05-09 17:08
 **/
public class ComputerTest {

    public static void main(String[] args) {
        Desktop one = new Desktop("Lenovo 111", "联想", "AMD", "22英寸", "立式机箱");

        NoteBook two = new NoteBook("T61", "IBM", "Intel", "14英寸", "7里电池");

        PDA three = new PDA("MyPal", "惠普", "Intel", "3.5英寸", "1300mAh充电池", "TFT触屏");

        System.out.println("请选择需要购买的机器：（1.台式机，2.笔记本，3.PDA）");
        Scanner scanner = new Scanner(System.in);
        int id = scanner.nextInt();
        Computer cmp = null;

        switch (id) {
            case 1:
                cmp =one;
                break;
            case 2:
                cmp = two;
                break;
            case 3:
                cmp = three;
                break;
        }
        if (cmp != null) {
            cmp.info();
        }
    }
}
